BDMS-433 NMA_MajorChemistry table and transfer logic for major chemistry data#381
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements end-to-end support for the legacy MajorChemistry table from NM_Aquifer_Dev_DB, including database model, migration, transfer logic, and comprehensive testing.
Changes:
- Added NMAMajorChemistry model with relationship to ChemistrySampleInfo
- Implemented transfer logic with dependency validation and batch processing
- Added configuration flag and proper sequencing after ChemistrySampleInfo transfer
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| db/nma_legacy.py | Adds NMAMajorChemistry model with foreign key to ChemistrySampleInfo and bidirectional relationship |
| alembic/versions/a7b8c9d0e1f2_create_nma_major_chemistry.py | Migration to create NMA_MajorChemistry table with indexes |
| transfers/major_chemistry.py | Transfer implementation with SamplePtID validation, batch upserts, and deduplication |
| transfers/transfer.py | Integrates MajorChemistryTransferer with configuration flag and proper sequencing |
| transfers/metrics.py | Adds metrics tracking for major chemistry transfers |
| tests/test_major_chemistry_legacy.py | Comprehensive CRUD tests for NMAMajorChemistry model |
| .env.example | Adds TRANSFER_MAJOR_CHEMISTRY configuration flag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Built out legacy MajorChemistry end‑to‑end and tightened transfer ordering/logging to respect dependencies on ChemistrySampleInfo.
What changed
Why
Testing